<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>打印测试页面</title>
    <style>
        body {
            font-family: "Microsoft YaHei", sans-serif;
            padding: 20px;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            border: 1px solid #ddd;
        }
        .print-btn {
            background-color: #2d8cf0;
            color: white;
            border: none;
            padding: 10px 20px;
            cursor: pointer;
            border-radius: 4px;
            margin-top: 20px;
        }
        @media print {
            .print-btn {
                display: none;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>打印功能测试页面</h1>
        <p>这是一个测试页面，用于测试浏览器的打印功能是否正常工作。</p>
        <button class="print-btn" id="printBtn">打印此页面</button>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const printBtn = document.getElementById('printBtn');
            
            printBtn.addEventListener('click', function() {
                console.log('打印按钮被点击');
                window.print();
            });
        });
    </script>
</body>
</html> 